﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.Xpo;
namespace ChuanPlus
{
    public class InvoiceDetails : XPLiteObject
    {
        int fInvoiceDetailsID;
        [Key(true)]
        public int InvoiceDetailsID
        {
            get { return fInvoiceDetailsID; }
            set { SetPropertyValue<int>("InvoiceDetailsID", ref fInvoiceDetailsID, value); }
        }
        [Association("Invoice-InvoiceDetails")]        
        Invoice fInvoiceNo;
        [Size(10)]
        
        public Invoice InvoiceNo
        {
            get { return fInvoiceNo; }
            set { SetPropertyValue<Invoice>("InvoiceNo", ref fInvoiceNo, value); }
        }
        Stock fStockID;
        public Stock StockID
        {
            get { return fStockID; }
            set { SetPropertyValue<Stock>("StockID", ref fStockID, value); }
        }
        double fQuantity;
        public double Quantity
        {
            get { return fQuantity; }
            set { SetPropertyValue<double>("Quantity", ref fQuantity, value); }
        }
        double fUnitPrice;
        public double UnitPrice
        {
            get { return fUnitPrice; }
            set { SetPropertyValue<double>("UnitPrice", ref fUnitPrice, value); }
        }
        public InvoiceDetails(Session session) : base(session) { }
        public InvoiceDetails() : base(Session.DefaultSession) { }
        /// <summary>
        /// Initializes a new instance of the InvoiceDetails class.
        /// </summary>
        /// <param name="fInvoiceDetailsID"></param>
        /// <param name="fInvoiceNo"></param>
        /// <param name="fID"></param>
        /// <param name="fQuantity"></param>
        /// <param name="fUnitPrice"></param>
        public InvoiceDetails(Session session, Invoice fInvoiceNo, Stock fStockID, double fQuantity, double fUnitPrice)
            : base(session)
        {
            
            this.fInvoiceNo = fInvoiceNo;
            this.fStockID = fStockID;
            this.fQuantity = fQuantity;
            this.fUnitPrice = fUnitPrice;
        }
        public override void AfterConstruction() { base.AfterConstruction(); }
    }
}
